﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace WirtualneNauczanie
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LoginButton_Click(object sender, EventArgs e)
        {
            /*  bool userNameExist = String.Equals(UserName.Text, "mietek2");
              bool passwordExist = String.Equals(Password.Text, "mietek2");

              if (userNameExist && passwordExist)
              {
                  FormsAuthentication.RedirectFromLoginPage(UserName.Text, false);
              }
              else
              {
                  BadInputLabel.Visible = true;
              }*/
            if (Membership.ValidateUser(UserName.Text, Password.Text))
            {                
                FormsAuthentication.RedirectFromLoginPage(UserName.Text, false);
                
                //Server.Transfer("~/Web/LoggedIn.aspx");
                
            }

            BadInputLabel.Visible = true;
        }
    }
}
